#!/bin/bash

name="hdgp-dev"
pass="61fSyiTY7jBdGLjw"

echo "步骤1/ : 创建管理用户,请稍等........."
echo "you are setting username : ${name}"
echo "you are setting password : $pass for ${name}"

sudo useradd $name -d /data/$name
if [ $? -eq 0 ];then
   echo "user ${name} is created successfully!!!"
else
   echo "user ${name} is created failly!!!"
   exit 1
fi
echo $pass | sudo passwd $name --stdin &>/dev/null
if [ $? -eq 0 ];then
   echo "${name}'s password is set successfully"
else
   echo "${name}'s password is set failly!!!"
fi


echo "步骤2/ 切换用户"